import request from '@/utils/request'
import qs from 'qs'

export function findListByPage(params) {
  return request({
    url: '/api/script/convert/list' + '?' + qs.stringify(params, { indices: false }),
    method: 'get'
  })
}

export function downloadFile(params) {
  return request({
    url: '/api/script/convert/list/download/file' + '?' + qs.stringify(params, { indices: false }),
    method: 'get',
    responseType: 'blob'
  })
}

export function del(pkId) {
  return request({
    url: '/api/script/convert/list/' + pkId,
    method: 'delete'
  })
}

export function queryContentById(crunPkId, histPkId) {
  return request({
    url: '/api/script/convert/list/' + crunPkId + '/' + histPkId,
    method: 'get'
  })
}

export function queryById(pkId) {
  return request({
    url: '/api/script/convert/list/' + pkId,
    method: 'get'
  })
}

export default {
  findListByPage,
  del,
  queryById,
  downloadFile,
  queryContentById
}
